<header class="flex items-center mb-6">
  <h1 class="crayons-title">Response templates</h1>
  <a href="<%= new_admin_response_template_path %>" class="crayons-btn ml-auto" role="button">Create new template</a>
</header>

<%= paginate @response_templates %>

<table class="crayons-table" width="100%">
  <thead>
    <tr>
      <th scope="col">Title</th>
      <th scope="col">Type Of</th>
      <th scope="col">User</th>
    </tr>
  </thead>
  <tbody class="crayons-card">
    <% @response_templates.each do |response_template| %>
      <tr>
        <td>
          <a href="<%= edit_admin_response_template_path(response_template.id) %>"><%= response_template.title %>
        </td>
        <td>
          <%= response_template.type_of %>
        </td>
        <td>
          <% if response_template.user_id.present? %>
            <%= link_to "@#{response_template.user.username}", user_url(response_template.user), target: "_blank", rel: :noopener %>
          <% end %>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>
<%= paginate @response_templates %>
